#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    InitWidget();
    InitConnections();
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::InitWidget()
{
    m_pClient = new Widget();
    m_pServer = new UdpServer();
}

void MainWindow::InitConnections()
{
    connect(ui->pbt_Client,&QPushButton::clicked,this,&MainWindow::clientWidget_Slots);
    connect(ui->pbt_Server,&QPushButton::clicked,this,&MainWindow::serverWidget_Slots);
}

void MainWindow::clientWidget_Slots()
{
    m_pClient->show();
}

void MainWindow::serverWidget_Slots()
{
    m_pServer->show();
}

